Skip to content

Pin browser-language cards on the dashboard#180

Open
Copilot wants to merge 9 commits into
mainfrom
copilot/add-javascript-to-index
Open

Pin browser-language cards on the dashboard#180
Copilot wants to merge 9 commits into
mainfrom
copilot/add-javascript-to-index

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Summary

Add client-side pinning for cards that match the visitor's browser languages so they appear first by default without losing access to the original dashboard order.

Changes

  • detect cards matching navigator.languages and move them to the front on load
  • add top-right thumbtack buttons on matched cards to toggle pinned/unpinned state
  • keep unpinned cards in the original completion-based order from the server
  • persist per-card unpinned choices in localStorage
  • style the pin button and use clean filled/outline thumbtack SVGs for pinned vs unpinned states

Validation

  • pre-commit run --all-files
  • python -m unittest discover -s tests (fails only in external link-check cases because several hosts do not resolve in the sandbox: python-docs-es.readthedocs.io, www.flowdas.com, git.afpy.org, python.org.br)

📊 Dashboard preview 📊: https://python-docs-translations.github.io/dashboard/180/merge/

Copilot AI requested a review from m-aciek April 23, 2026 23:39
@m-aciek m-aciek marked this pull request as ready for review April 24, 2026 00:02
@m-aciek m-aciek requested a review from StanFromIreland April 24, 2026 00:02
Copy link
Copy Markdown
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 on this without a way to also optionally sort them by % completion/alphabetically. While this may be more convenient for some it will also not allow them to view the dashboard how it currently displays languages.

Comment thread .gitignore
@m-aciek
Copy link
Copy Markdown
Collaborator

m-aciek commented Apr 24, 2026

-1 on this without a way to also optionally sort them by % completion/alphabetically. While this may be more convenient for some it will also not allow them to view the dashboard how it currently displays languages.

I think engaging people to contribute is a higher priority purpose than providing a dry information. By bringing the user language(s) to front it is harder to miss them, on a page that already force you to scroll to see through all languages (we have now 25 of them). In my opinion moving one or two languages in front is a small disruption to the order.

To satisfy use case of "universal" view we could add an opt-out toggle to "unpin" users language(s). Would a thumbtack icon as first on right in top navbar be understandable/discoverable? We could/should make it disabled (grayed out) if none of user's languages is listed on the dashboard.

@StanFromIreland
Copy link
Copy Markdown
Member

To satisfy use case of "universal" view we could add an opt-out toggle to "unpin" users language(s). Would a thumbtack icon as first on right in top navbar be understandable/discoverable? We could/should make it disabled (grayed out) if none of user's languages is listed on the dashboard.

Something like this would be good. But, maybe have the thumbtack in the corner of the cards?

@m-aciek m-aciek marked this pull request as draft April 25, 2026 14:05
@m-aciek m-aciek marked this pull request as ready for review April 25, 2026 15:12
@m-aciek m-aciek marked this pull request as draft April 25, 2026 15:38
Copilot AI changed the title Reorder dashboard cards by user's browser languages Fix thumbtack icon visual noise: correct swapped SVG paths Jun 3, 2026
@m-aciek
Copy link
Copy Markdown
Collaborator

m-aciek commented Jun 4, 2026

@copilot resolve the merge conflicts in this pull request

…t-to-index

# Conflicts:
#	.gitignore
#	templates/index.html.jinja
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 4, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 03112a7. The two conflicts were:

  • .gitignore — kept both __pycache__ (from the branch) and *.pyc (added by main)
  • templates/index.html.jinja — kept the pin-button IIFE and adopted main's {% endblock extrascript %} syntax

All linters pass after auto-applying the djLint formatting change (space before /> in SVG path tags).

@m-aciek m-aciek changed the title Fix thumbtack icon visual noise: correct swapped SVG paths Pin browser-language cards on the dashboard Jun 4, 2026
@m-aciek m-aciek marked this pull request as ready for review June 4, 2026 00:17
@m-aciek m-aciek requested a review from StanFromIreland June 4, 2026 00:17
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03112a7863

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/style.css
@m-aciek m-aciek marked this pull request as draft June 4, 2026 00:20
@m-aciek m-aciek marked this pull request as ready for review June 4, 2026 00:27
@StanFromIreland
Copy link
Copy Markdown
Member

I played around with it, but I feel pinning the entire set is a little odd compared to just the first entry:

image

IMO, this feels like something that should be limited to the preferred language. It preserves the dashboard’s completion-based order with minimal disruption. If I got several pinned cards I'd be confused as a user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants